<?php
/**
 * Created by PhpStorm.
 * User: asus
 * Date: 2021/11/26
 * Time: 15:29
 */
namespace app\api\controller\user;

use app\api\controller\Controller;
use app\api\model\UserReview;

class Review extends Controller
{
    public function employeeReview()
    {
        $user = $this->getUser(false);
//        用户idexecute
        $user_id = $user['user_id'];
        $name = input('name','','trim');
        $company = input('company','','trim');
        $department = input('department','','trim');
        $position = input('position','','trim');
        $job = input('job','','trim');
//        remark
        $remark = input('remark','','trim');
        $phone = input('phone','','trim');
        $wxapp_id = input('wxapp_id','','trim');

        $data = [
            "user_id" => $user_id,
            "name" => $name,
            "company" => $company,
            "department" => $department,
            "position" => $position,
            "job" => $job,
            'remark' => $remark,
            "phone" => $phone,
            "wxapp_id" => $wxapp_id,
            "add_time" => date("Y/m/d h:i:s"),
        ];

        $res = UserReview::insert($data);

        if($res){
            $msg  = ['code'=>200,'msg'=>'申请成功，请耐心等候审核'];
            return $msg;
        }else{
            $msg  = ['code'=>0,'msg'=>'申请失败'];
            return $msg;
        }
    }
}